using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using emp.Model;
using emp.IDAL;
using emp.BLL;
using emp.ProcessFlow;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;

public partial class crm_quest_QuestionLableModify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            this.hfqslid.Value = Request.Params["qsl_id"].ToString();
            initial(Int32.Parse(hfqslid.Value));
        }
    }

    void initial(int qslid)
    {
        Quest qu = new Quest();
        QuestLabelInfo qslinfo = qu.getQuestLabelInfo(qslid);
        this.txtLabelName.Text = qslinfo.QSL_NAME;
        this.txtLabelShow.Text = qslinfo.QSL_SHOW;
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        QuestLabelInfo qslinfo = new QuestLabelInfo();
        qslinfo.QSL_ID = Int32.Parse(hfqslid.Value);
        qslinfo.QSL_NAME = txtLabelName.Text.Trim();
        qslinfo.QSL_SHOW = txtLabelShow.Text.Trim();

        try
        {
            if (HttpContext.Current.Session["USER_KEY"] != null)
            {
                qslinfo.QSL_MOD_ID = Convert.ToInt32(HttpContext.Current.Session["USER_KEY"].ToString());
            }
            else
            {
                qslinfo.QSL_MOD_ID = 11;
            }
        }
        catch { }
        Quest qu = new Quest();
        qu.UpdateQuestLabel(qslinfo);

        HttpContext.Current.Response.Redirect("QuestionLableList.aspx", true);
    }
}
